﻿//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	SPCommonJobs.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using System;
using Microsoft.SharePoint;

namespace Smart.Common.Jobs
{
	public class SPCommonJobs
	{
		public virtual void Register(SPWeb web)
		{
			try
			{
				SPJob.Register<NotificationJob>(Const.TimerJobs.Notification.JobName, web);
				SPJob.Register<CleanupJob>(Const.TimerJobs.Cleanup.JobName, web);
			}
			catch (Exception x)
			{
				H.LX("SPJobAddon.Register", x);
			}
		}

		public void Unregister(SPWeb web)
		{
			try
			{
				SPJob.Unregister(Const.TimerJobs.Notification.JobName, web);
				SPJob.Unregister(Const.TimerJobs.Cleanup.JobName, web);
			}
			catch (Exception x)
			{
				H.LX("SPJobAddon.Unregister", x);
			}
		}
	}
}